package com.xuetang9.t9.xinhuaxia.service.impl;

import com.xuetang9.t9.xinhuaxia.beans.SocialCollection;
import com.xuetang9.t9.xinhuaxia.mappers.SocialCollectionMapper;
import com.xuetang9.t9.xinhuaxia.service.ISocialCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 陈焱
 * @version 1.0
 * @desc
 * @time 2020/3/3 下午 2:18
 * @copyright liyq
 * @address 成都西部国际金融中心2栋2201
 **/
@Service
public class SocialPublishCollectionService implements ISocialCollectionService {

    @Autowired
    private SocialCollectionMapper socialCollectionMapper;

    @Override
    public int getCollectionCountByPublishId(int pid) {
        return socialCollectionMapper.getCollectionCountByPid(pid);
    }

    @Override
    public boolean addCollection(SocialCollection socialCollection) {
        return socialCollectionMapper.insert(socialCollection)>0;
    }

    @Override
    public List<SocialCollection> querySocialCollectionbyuserid(SocialCollection socialCollection) {
        return socialCollectionMapper.select(socialCollection);
    }

    @Override
    public int getCollectionCountByPiduid(SocialCollection socialCollection) {
        return socialCollectionMapper.selectCount(socialCollection);
    }

    @Override
    public boolean remove(SocialCollection socialCollection) {
        return socialCollectionMapper.delete(socialCollection)>0;
    }
}
